
export default function useSelectOptions() {
    const deviceModelList = ref([])
    const flavourNameList = ref([])
    const flavourTypeList = ref([])

    const getQueryModelList = _ => {
        g_api.device
            .apiDeviceQueryModelList()
            .then(({ code, data }) => {
                if (code === '200' && data) {
                    // console.log('data', data)
                    deviceModelList.value = data.map(item => ({
                        value: item,
                        label: item
                    }))
                }
            })
            .finally(() => { })
    }

    const getflavourNameList = _ => {
        g_api.foodstuff
            .apiFlavourDropList()
            .then(({ code, data }) => {
                if (code === '200' && data) {
                    // console.log('data', data)
                    flavourNameList.value = data
                }
            })
            .finally(() => { })
    }

    const getQueryTypeList = _ => {
        flavourTypeList.value = g_options.flavourTypeOptions
    }

    return {
        deviceModelList,
        flavourNameList,
        flavourTypeList,
        getQueryModelList,
        getflavourNameList,
        getQueryTypeList
    }

}